﻿using Chen.IdentityServer4;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace AbpDemo.EntityConfig
{
    public class SysuserRoleConfig : IEntityTypeConfiguration<SysuserRole>
    {
        public void Configure(EntityTypeBuilder<SysuserRole> b)
        {
            b.ToTable(nameof(SysuserRole));

            b.Property(x => x.SysUserID).IsRequired();
            b.Property(x => x.RoleID).IsRequired();

            b.Property(x => x.CreateBy).HasComment("创建人").IsRequired();
            b.Property(x => x.UpdateBy).HasComment("修改人");
            b.Property(x => x.CreateTime).HasComment("创建时间").IsRequired();
            b.Property(x => x.UpdateTime).HasComment("修改时间");
            b.Property(x => x.Status).HasComment("1正常 0已删除").IsRequired().HasDefaultValue(1);

            //b.ApplyObjectExtensionMappings();
        }
    }
}
